#ifndef __SYS_H
#define __SYS_H	
#include "stm32f10x.h"

#define THNETTOOLSTEST_PRIO       29  //* 网络工具测试线程优先级
#define THTCPCOMMU1_PRIO          28  //* tcp通讯测试线程1优先级
#define THTCPCOMMU2_PRIO          27  //* tcp通讯测试线程2优先级
#define THUDPCOMMU_PRIO           26  //* udp通讯测试线程优先级
#define THOSTIMERCOUNT_PRIO			 	25	//* onps栈定时器计数线程优先级
#define THPPPHANDLER_PRIO					21	//* ppp栈主处理线程优先级

//* 电平值
typedef enum {
	LOW  = 0,
	HIGH = 1
} ENUM_LEVEL;

typedef unsigned int BOOL;

//* 关键外设的电源通断引脚
//*=============================================================================
//* 4G模块用到的相关引脚
#define	PORT_M4G_POWER			GPIOB
#define	PIN_M4G_POWER				GPIO_Pin_12
#define M4G_POWER_ON()			PORT_M4G_POWER->BSRR = PIN_M4G_POWER
#define M4G_POWER_OFF()	  	PORT_M4G_POWER->BRR  = PIN_M4G_POWER

//* LED
//*=============================================================================
#define	PORT_LED_RUN				GPIOB
#define	PORT_LED_WARN				GPIOB
#define	PORT_LED_FAULT			GPIOC
#define	PIN_LED_RUN					GPIO_Pin_7
#define LED_RUN(level)			GPIO_WriteBit(PORT_LED_RUN,   PIN_LED_RUN,   level ? Bit_SET : Bit_RESET)
#define	PIN_LED_WARN				GPIO_Pin_9
#define LED_WARN(level)			GPIO_WriteBit(PORT_LED_WARN,  PIN_LED_WARN,  level ? Bit_SET : Bit_RESET)
#define	PIN_LED_FAULT				GPIO_Pin_13
#define LED_FAULT(level)		GPIO_WriteBit(PORT_LED_FAULT, PIN_LED_FAULT, level ? Bit_SET : Bit_RESET)

//* 测试代码配置
//*=============================================================================
#define PING_TEST_EN      0 //* ping测试使能
#define DNS_QUERY_TEST_EN 0 //* dns查询测试使能
#define SNTP_TEST_EN      1 //* sntp网络校时测试使能

#endif
